package Server.network.server;

import Server.Opcodes;
import Server.world.character;
import Server.world.PcInstance;
import Server.data.ServerSetting;

public class CharStat extends BasePacket{

	public CharStat(character use){
		PcInstance cha = (PcInstance)use;
		writeC(Opcodes.S_OPCODE_OWNCHARSTATUS);
		writeD(cha.get_objectId());
		writeC(cha.get_level());
		writeD((int)cha.get_exp());
		writeC(cha.get_str());
		writeC(cha.get_int());
		writeC(cha.get_wis());
		writeC(cha.get_dex());
		writeC(cha.get_con());
		writeC(cha.get_cha());
		writeH(cha.get_currentHp());
		writeH(cha.get_maxHp());
		writeH(cha.get_currentMp());
		writeH(cha.get_maxMp());
		writeC((266-cha.get_ac()));
		writeD(ServerSetting.getInstance().GameStartTime);
		writeC(cha.get_food());
		writeC(cha.get_Inventory().WEIGHT());
		writeH(cha.get_lawful());
		writeC(cha.get_fireress());
		writeC(cha.get_waterress());
		writeC(cha.get_windress());
		writeC(cha.get_earthress());
	}

	public byte[] send(){
		
		return getBytes();
	}
}